home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991 …esperately Seeking Seven / Desperately Seeking Seven.2mg / Dev.CD.8 / Essentials / Tools / DTS.Samples / SC02BusyBox / BusyBox.asm / UMenu.asm < prev    next >
Encoding:
Assembly Source File  |  1990-05-25  |  2.6 KB  |  113 lines  |  [04] ASCII Text (0x0000)

  1. ***********************************************************************
  2. *
  3. * busybox umenu.asm -- Version 3.0 
  4. *
  5. * Copyright (c)
  6. * Apple Computer, Inc.  1986-1990
  7. * All Rights Reserved.
  8. *
  9. * Developer Technical Support Apple II Sample Code
  10. *
  11. * This file contains the code which implements menus in the
  12. * busybox program.
  13. *
  14. ***********************************************************************
  15.  
  16.                case on
  17.  
  18.                copy 2/ainclude/e16.types
  19.                copy 2/ainclude/e16.event
  20.                copy busybox.equ
  21.  
  22.                mcopy macros/umenu.macros
  23.  
  24.                longi on
  25.                longa on
  26.  
  27. doQuitItem     start
  28.  
  29.                inc quitFlag             ;That's all folks.
  30.                rts
  31.  
  32.                end
  33.  
  34. ***********************************************************************
  35.  
  36. doAboutItem    start
  37.  
  38.                pha                      ;Pop up the resource Alert.
  39.                pea 4
  40.                pea 0|-16
  41.                pea 0
  42.                pea 1|-16
  43.                pea 1
  44.                _AlertWindow
  45.                pla
  46.                rts
  47.  
  48.                end
  49.  
  50. ***********************************************************************
  51. * Procedure to handle all menu selections.  Examines the event.TaskData
  52. * menu item ID word from TaskMaster (from Event Manager) and calls the
  53. * appropriate routine.  While the routine is running the menu title is
  54. * still highlighted.  After the routine returns, we unhilight the
  55. * menu title.
  56.  
  57. doMenu         start
  58.  
  59.                lda event+owmTaskData    ;Item number
  60.                cmp #AboutItem
  61.                bne aa
  62.                jsr doAboutItem
  63.                jmp zz
  64.  
  65. aa             cmp #CloseItem
  66.                bne bb
  67.                jsr doCloseTop
  68.                jmp zz
  69.  
  70. bb             cmp #QuitItem
  71.                bne zz
  72.                jsr doQuitItem
  73.  
  74. zz             pea 0
  75.                lda event+owmTaskData+2  ;menuNum
  76.                pha
  77.                _HiliteMenu
  78.                rts
  79.  
  80.                end
  81.  
  82. ***********************************************************************
  83.  
  84. setupMenus     start
  85.  
  86.                pha                      ;Get menus from resource
  87.                pha
  88.                pea refIsResource
  89.                pea $1000|-16
  90.                pea $1000
  91.                pea 0|-16
  92.                pea 0
  93.                _NewMenuBar2
  94.                _SetSysBar
  95.  
  96.                pea 0|-16
  97.                pea 0
  98.                _SetMenuBar
  99.  
  100.                pea AppleMenuID
  101.                _FixAppleMenu
  102.  
  103.                pha
  104.                _FixMenuBar
  105.                pla
  106.  
  107.                _DrawMenuBar
  108.                rts
  109.  
  110.                end
  111.  
  112.                END
  113.